<?php

require("osc.php");

/** mein eigno test!
  */
function send_osc($message) {
    $c = new OSCClient();
	$c->set_destination($_SERVER['REMOTE_ADDR'], 6449);
	
	if($message == "pause")
		$m1 = new OSCMessage("/pause", array("drums"));
	else
		$m1 = new OSCMessage("/instrument", array("drums", "sunny", 30.0, 16.0, 10.0, "NO"));
	//$m1 = new OSCMessage("/foo");
   // $m1->add_arg($message, "s");

    echo 'awesome! <i>',$message,'</i> sent to: <b>',$_SERVER['REMOTE_ADDR'],':6449</b>';
    $c->send($m1);
}

if(isset($_POST["message"])){
	send_osc($_POST["message"]);
}
?>

<html>
     <form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
          text: <input type="text" name="message">
          <input type="submit" name="absenden" value="senden">
     </form>
</html>